<%@ include file="../common.jsp" %>


<tr align="left">
	<td class="spacingColumnWidthLess"></td>
	<td colspan="3" align="right">
		<div class="ui-corner-all" style="width: 80%; border-style: dotted; border-width:1px; height: 3em; padding: 10px; text-align: left;">
			<span class="formLabel" >Attach a File</span>
			<input type="file" name="docContent" />
			<c:choose>
				<c:when test="${docDetailsForm.docId>0}">
						<input type="hidden" value="updateDocument" name="_eventId">
						<br>
						<a target="_blank" href="downloadAttachment/${docDetailsForm.docId}.htm">${docDetailsForm.docName}</a>
				</c:when>
				<c:otherwise>
					<input type="hidden" value="uploadNewDoc" name="_eventId">
				</c:otherwise>
			</c:choose>
		</div>
	</td>
	<td class="spacingColumnWidthMedium"></td>
	<td colspan="3">
		<c:if test='${!fn:contains(currentDocStatus,"RenewWfip")}'>
			<div class="ui-corner-all" style="width: 80%; border-style: dotted; border-width:1px; height: 3em; padding: 10px; overflow: auto;">
				<span class="formLabel">Link Documents&nbsp;
					<a href="#" onclick="javascript:showDocumentLookUpDialog('uploadNewDocForm');" style="text-decoration: none;">
						<img alt=""  src='<c:url value="/customTheme/Icons/BlueLotus_DMS_icons-30.png"></c:url>'>
					</a>
					<input class="formButton ui-corner-all" type="button" value="Remove" onclick="deleteDocument()"/>
				</span>
				<ul id="linkedDocId" class="userListClass">
				<c:forEach items="${linkedDocumentMap}" var="linkedDocumentMap">
					<li id="${linkedDocumentMap.key}" class="ui-state-default">${linkedDocumentMap.value}</li>
					<input type="hidden" name="linkedDocId" id="${linkedDocumentMap.key}" value="${linkedDocumentMap.key}">
				</c:forEach>
				</ul>
					<c:forEach var="linkedDocumentList" items="${linkedDocumentList}">
	    					<input type="hidden" name="oldLinkedDocument" value="${linkedDocumentList}"></input>
	   				</c:forEach>
	   				
			</div>
		</c:if>
	</td>
	<td class="spacingColumnWidthLess"></td>
</tr>
<tr>
		<td class="spacingColumnWidthLess"></td>
		<td class="formError" colspan="3" align="center">
			<form:errors path="docContent" cssClass="errorMsg"></form:errors>
		</td>
		<td class="spacingColumnWidthMedium"></td>
		<td class="formLabel"></td>
		<td class="spacingColumnWidthLess"></td>
		<td class="formError">
			 
		</td>
		<td class="spacingColumnWidthLess"></td>
	</tr>
<tr class="formSpacingRow formBlockColor"><td colspan="9"></td></tr>


	<%-- <tr>
		<td class="text ui-widget"><label>Attachment</label> </td>
		<td class="spacingColumn"></td>
		<td>
			<input type="file" name="docContent" /> 
		</td>
		<td class="spacingColumn"></td>
		<td align="right">
			<input type="hidden" value="ajaxRequest" name="ajaxSource">

<!-- 			<input type="button" value="Upload And Save Document Details" onclick="loadContentToServer('uploadNewDocForm','contentDiv')">	 -->
<td class="spacingColumn"><img alt="" height="50" src="<c:url value="/upload-icon.png"></c:url>" onclick="loadContentToServer('uploadNewDocForm','contentDiv')" ></td>
		

<!-- 			<input type="button" value="Upload And Save Document Details" onclick="loadContentToServer('uploadNewDocForm','contentDiv')" />	 -->


		<c:choose>
			<c:when test="${docDetailsForm.docId>0}">
					<input type="hidden" value="updateDocument" name="_eventId">
					<tr>
						<td>
							<a target="_blank" href="downloadAttachment/${docDetailsForm.docId}.htm">${docDetailsForm.docName}</a>
						</td> 
					</tr>
			</c:when>
			<c:otherwise>
				<input type="hidden" value="uploadNewDoc" name="_eventId">
			</c:otherwise>
		</c:choose>
	</tr>
 	<tr>
 		<td colspan="2"/>
		<td>
			<form:errors path="docContent" cssClass="text errorMsg"> </form:errors>
		</td>
	</tr> --%>
 